home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/unix/c/RCS/lseek,v $
- * $Date: 1996/10/30 21:59:01 $
- * $Revision: 1.2 $
- * $State: Rel $
- * $Author: unixlib $
- *
- * $Log: lseek,v $
- * Revision 1.2 1996/10/30 21:59:01 unixlib
- * Massive changes made by Nick Burret and Peter Burwood.
- *
- * Revision 1.1 1996/04/19 21:35:27 simon
- * Initial revision
- *
- ***************************************************************************/
-
- static const char rcs_id[] = "$Id: lseek,v 1.2 1996/10/30 21:59:01 unixlib Rel $";
-
- #include <errno.h>
-
- #include <sys/syslib.h>
- #include <sys/types.h>
- #include <sys/unix.h>
- #include <sys/dev.h>
- #include <sys/os.h>
- #include <unistd.h>
-
- off_t
- lseek (int fd, off_t offset, int whence)
- {
- register struct file *f;
-
- if (BADF (fd))
- {
- errno = EBADF;
- return (-1);
- }
-
- f = __u->file + fd;
-
- return (__funcall ((*(__dev[major (f->dev)].lseek)), (minor (f->dev), offset, whence, f)));
- }
-